package com.anguin.mylibrary.entity;

import java.util.Objects;

public class TagEntity
{
    private int tagId;      // 标签ID
    private String name;    // 标签名称

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TagEntity tagEntity = (TagEntity) o;
        return tagId == tagEntity.tagId && Objects.equals(name, tagEntity.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(tagId, name);
    }

    @Override
    public String toString() {
        return "Tag{" +
                "tagId=" + tagId +
                ", name='" + name + '\'' +
                '}';
    }

    public TagEntity(){}

    // 构造函数
    public TagEntity(int tagId, String name) {
        this.tagId = tagId;
        this.name = name;
    }

    // Getter和Setter
    public int getTagId() {
        return tagId;
    }

    public void setTagId(int tagId) {
        this.tagId = tagId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
